package com.codi.bus.core.dao.impl;

import com.codi.base.dao.BaseDAOImpl;
import com.codi.bus.core.dao.FundWarehouseMappingDao;
import com.codi.bus.core.domain.FundWarehouseMapping;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class FundWarehouseMappingDaoImpl extends BaseDAOImpl<FundWarehouseMapping> implements FundWarehouseMappingDao{

    @Override
    public int addMapping(FundWarehouseMapping mapping) {
        return this.insert(generateStatement("insertSelective"), mapping);
    }

    @Override
    public int deleteMapping(Long mappingId) {
        return this.delete(generateStatement("deleteByPrimaryKey"), mappingId);
    }

    @Override
    public int updateMapping(FundWarehouseMapping mapping) {
        return this.update(generateStatement("updateByPrimaryKeySelective"), mapping);
    }

    @Override
    public List<FundWarehouseMapping> queryByWareHouseId(Long wareHouseId) {
        return this.findList(generateStatement("queryByWareHouseId"), wareHouseId);
    }

    @Override
    public FundWarehouseMapping queryOne(Long mappingId) {
        return this.getObject(generateStatement("selectByPrimaryKey"), mappingId);
    }
}
